[1] "species" "island" "bill_length_mm"
[4] "bill_depth_mm" "flipper_length_mm" "body_mass_g"
[7] "sex" "year"
Slides: bit.ly/2025-rss-mlops
Access to the virtual environment (if you don’t want to install anything):
Master password: passionfruit-pineapple
https://vetiver-mlops.jumpingrivers.training/welcome/
Password: passionfruit-pineapple
Background in Astrophysics and Data Science.
Principal Data Scientist @ Jumping Rivers:
Project management.
Python and ML support for clients.
Maintains and teaches courses in Python, SQL, ML.
Hobbies include hiking and travelling.
↗ jumpingrivers.com 𝕏 @jumping_uk
Presentation slides (bit.ly/2025-rss-mlops).
The slides use R code.
A Python version of the live demo is also available.
The exercises will apply the same techniques to a different data set and model.
What type of Workbench Session / IDE to use?
Introduction to MLOps
Building a basic MLOps workflow
We will be deploying models locally only…
Want to contribute?
The typical data science workflow:
MLOps: Machine Learning Operations
Let’s set up a basic MLOps workflow!
Palmer Penguin dataset
Let’s predict species using flipper length, body mass and island!
Open demo.R in RStudio / demo.ipynb in Jupyter…
Open exercises.R / exercises.ipynb
Attempt “Task 1: Data loading and tidying”
Need help? Check solutions.R / solutions.ipynb or raise your hand
08:00
Our model object can now be used to predict species:
v_model is a list with six elements
Go back to demo.R in RStudio / demo.ipynb in Jupyter…
Open exercises.R / exercises.ipynb
Attempt “Task 2: Modelling”
Need help? Check solutions.R / solutions.ipynb or raise your hand
10:00
Retrieve a model
Inspect the stored versions
We deploy models as APIs which take input data and send back model predictions.
We can use a {plumber} API (R) or FastAPI (Python) to deploy a {vetiver} model.
Check the deployment with:
Checking that our API works!
Go back to demo.R in RStudio / demo.ipynb in Jupyter…
Open exercises.R / exercises.ipynb
Attempt “Task 3: Deploying your model”
Need help? Check solutions.R / solutions.ipynb or raise your hand
05:00
Vetiver is available for both Python and R!
In Python you would use Python ML libraries rather than {tidymodels}
Vetiver documentation: vetiver.posit.co
Try deploying locally to check that your model API works as expected.
Use environment managers like {renv} to store model dependencies.
Use containers like Docker to bundle model source code with dependencies.
Our Dockerfile contains a series of commands to:
Set the R version and install the system libraries.
Install the required R packages.
Run the API.
Some platforms offer free trials (e.g. SageMaker).
May be cheaper if you’re already invested in a particular cloud platform.
Costs can rise depending on computational resources consumed.
Model building and deployment use different environments.
Deployment is just the beginning…
Open exercises.R / exercises.ipynb
Attempt “Task 4: Detecting model drift”
Need help? Check solutions.R / solutions.ipynb or raise your hand
08:00
As your data grows, run regular checks of model performance.
Monitor key model metrics over time.
You may notice a downward trend…
Retrain the model with the latest data and redeploy.
As data and user base grows, your model needs to scale.
Upgrade your computational resources.
Consider moving from a relational database to a data warehouse.
Check how many users your license (AWS, Posit, etc) permits.
Vetiver has built in functions to track scoring metrics over time.
Requires a time variable in the dataset.
Load the model from your {pins} board.
Make sure you are scoring the deployed version.
Specify the period for scoring (weeks, months, years, …).
Model metrics can also be stored with {pins}!
Consider our life expectancy data from the exercises…
Compute scoring metrics over specified period:
Requires a Date column (generate from Year).
recent_data: could be data from the past year or all historical data.
Pin the metrics
Retraining and redeployment can happen at the click of a button.
Encourages good practices like model versioning and packaging of source code.
Reduces human error.
Well defined and reproducible.
Consider whether it is worth the cost/effort before starting.
Any questions?
Visit us at the Jumping Rivers stand
Check out my Thursday workshop: “Dynamic Presentations with Quarto”
Like Vetiver, Quarto is also maintained by Posit and multilingual by design
Render HTML, PDF and Word documents that combine plain text and code
Create your first slide deck in Quarto!
Check out Aida’s lightning talk!
Join us for Shiny In Production (8-9 Oct), Newcastle Upon Tyne
A half day of workshops followed by a day of talks on all things Shiny
Discount code (30% off): RSS2025
Jumping Rivers is organising free, monthly webinars!
Upcoming topics include Scalable Shiny Apps, Machine Learning with Python, Introduction to the Posit Ecosystem
Next webinar: 18 September
Find out more at jumpingrivers.com/blog/jumping-rivers-webinar-launch/
Follow “Jumping Rivers Ltd” on LinkedIn to keep up to date
Slides: bit.ly/2025-rss-mlops
GitHub repo: github.com/jumpingrivers/2025-rss-mlops
Vetiver blog series: jumpingrivers.com/blog/?search=vetiver
Vetiver documentation: vetiver.posit.co
Shiny In Production shiny-in-production.jumpingrivers.com (RSS2025 for 30% off)